﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using KetBanBonPhuong;
using Tom;

public partial class UserControls_Login : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LinkButton_ResetPassword_Click(object sender, EventArgs e)
    {
        Response.Redirect("ResetPassword.aspx");
    }
    protected void Button_SignIn_Click(object sender, EventArgs e)
    {
        int UserID = User.GetUserID(TextBox_UserName.Text.Trim(), Encrypt.MD5Encrypt(TextBox_Password.Text)); 
        if ( UserID == -1)
        {
            Label_result.Text = "Sai mật khẩu hoặc tên đăng nhập";
        }
        else
        {
            Session["UserID"] = UserID;
            Response.Redirect("Home.aspx");
        }
    }
}
